import com.powerfl.frm.taf.*;

import flash.system.*;

private var _airWindow:*;
private function airInit():void{
	if( Security.sandboxType === Security.APPLICATION ){
		_airWindow = stage['nativeWindow'];
	}
}
//-----------------------------------------------------------------------------------------------------------
final public function airWindowSet( $title:String, $width:Number, $height:Number, $x:Number = -2147483648, $y:Number = -2147483648 ):void{
	if( _airWindow ){
		_airWindow.width = $width + _airWindow.bounds.width - stage.stageWidth;
		_airWindow.height = $height + _airWindow.bounds.height - stage.stageHeight;
		if( $x === $NONE ){}else{
			_airWindow.x = $x;
		}
		if( $y === $NONE ){}else{
			_airWindow.y = $y;
		}
		_airWindow.title = $title;
	}
}
final public function airWindowClose():void{
	if( _airWindow ){
		_airWindow.close();
	}
}
final public function airWindowOpen():void{
	if( _airWindow ){
		_airWindow.activate();
	}
}
final public function airWindowRestore():void{
	if( _airWindow ){
		_airWindow.restore();
	}
}
final public function airWindowMaximize():void{
	if( _airWindow ){
		_airWindow.maximize();
	}
}
final public function airWindowMinimize():void{
	if( _airWindow ){
		_airWindow.minimize();
	}
}
